package com.example.pearl.common.tree;

import java.util.ArrayList;
import java.util.List;

public class TreeNode {
    private Integer id;
    private Integer parentId;
    private String name;
    private List<TreeNode> children = new ArrayList<>();

    // 构造函数、getter 和 setter
    public TreeNode(Integer id, Integer parentId, String name) {
        this.id = id;
        this.parentId = parentId;
        this.name = name;
    }

    // getter 和 setter 方法
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<TreeNode> getChildren() {
        return children;
    }

    public void setChildren(List<TreeNode> children) {
        this.children = children;
    }
}
